<script setup>
import {ref} from 'vue'
import {test} from '@/axios'
const form = ref({
  name: null,
  content: null,
  abstract: null,
  note: null,
  category: null,
  author: null,
  abstractTime: [],
})
const formRef = ref()
const rules = ref({})
const handlerSubmit = () => {
  formRef.value.validate(valid=>{
    if(valid) {
      test().then(res => {
        console.log(res)
      })
    }
  })
}
</script>

<template>
  <el-form :model="form" ref="formRef" label-width="auto" inline :rules="rules">
    <el-row>
      <el-col :span="6">
        <el-form-item label="名称:" prop="name">
          <el-input v-model="form.name" clearable/>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="分类:" prop="category">
          <el-input v-model="form.category" clearable/>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="作者:" prop="author">
          <el-input v-model="form.author" clearable/>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="摘要时间:" prop="abstractTime">
          <el-input v-model="form.abstractTime" clearable/>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="内容:" prop="content">
          <el-input v-model="form.content" clearable style="width: 100%;"/>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="摘要:" prop="abstract">
          <el-input v-model="form.abstract" clearable/>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="笔记:" prop="note">
          <el-input v-model="form.note" clearable/>
        </el-form-item>
      </el-col>

      <el-col :span="6" >
        <el-button type="primary" @click="handlerSubmit">搜索</el-button>
        <el-button type="success">清空</el-button>
      </el-col>
    </el-row>
  </el-form>
</template>

<style scoped>

</style>